droptarget: Fix confusion around ::leave signal
authorMatthias Clasen <mclasen@redhat.com>
Fri, 8 May 2020 12:47:06 +0000 (08:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 8 May 2020 12:50:44 +0000 (08:50 -0400)
The leave signal should not take any arguments,
don't pass the GdkDrop. Update the documentation,
fix the emission and update users to match.

This was showing up as crash when dragging files
over the places sidebar.

gtk/gtkdroptarget.c
gtk/gtkplacessidebar.c

index dac70c7da57ae61024780e61d79cf24a6df7679d..ad38fc683ba008104ce48b30422977cfe890cc27 100644 (file)
@@ -471,7 +471,7 @@ gtk_drop_target_handle_crossing (GtkEventController    *controller,
           crossing->new_target == widget)
         return;
 
-      g_signal_emit (self, signals[LEAVE], 0, self->drop);
+      g_signal_emit (self, signals[LEAVE], 0);
       if (!self->dropping)
         gtk_drop_target_end_drop (self);
       gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
@@ -731,7 +731,6 @@ gtk_drop_target_class_init (GtkDropTargetClass *class)
   /**
    * GtkDropTarget::leave:
    * @self: the #GtkDropTarget
-   * @drop: the #GdkDrop
    *
    * The ::leave signal is emitted on the drop site when the pointer
    * leaves the widget. Its main purpose it to undo things done in
index 178c3bde666f6d60d95a62165fec70014e3e5ff9..06712a79e283a4f3306da8433a2998099f9223f2 100644 (file)
@@ -1912,7 +1912,6 @@ dnd_finished_cb (GdkDrag          *drag,
  */
 static void
 drag_leave_callback (GtkDropTarget *dest,
-                     GdkDrop       *drop,
                      gpointer       user_data)
 {
   GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);